/*
 *	ApOS (Another Project software for s3c2410)
 *	
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License version 2 as
 *	published by the Free Software Foundation.
 *			
 *
 */
#ifndef _LCD_H
#define _LCD_H



#define LCDFRAMEBUFFER 	0x30800000
#define LCD_XSIZE_TFT 	(640)	
#define LCD_YSIZE_TFT 	(480)
#define SCR_XSIZE_TFT 	(LCD_XSIZE_TFT*2)
#define SCR_YSIZE_TFT 	(LCD_YSIZE_TFT*2)
#define M5D(n)		((n)&0x1fffff)
// rLCDCON1 val
#define CLKVAL_TFT 		(0x01)
#define MMODE_EACH_FRAME 	(0)	
#define TFT_LCD_PANEL		(0x03)	
#define MODE_16_BPP_TFT		(0x0c)
#define ENVID			(0)
// rLCDCON2 val
#define VBPD		((33-1)&0xff)
#define LINEVAL_TFT	(LCD_YSIZE_TFT-1)
#define VFPD 		((10-1)&0xff)
#define VSPW		((2-1) &0x3f)
// rLCDCON3 val
#define HBPD		((48-1)&0x7f)
#define HOZVAL_TFT	(LCD_XSIZE_TFT-1)
#define HFPD		((16-1)&0xff)
// rLCDCON4 val
#define MVAL		(13)
#define HSPW		((96-1)&0xff)
// rLCDCON5 val
#define LCD_POWER_ON 	1
#define INVLEND_INVERTED 	1

// rLCDINTMSK val
#define FIWSEL		1
#define INT_FRSYN	1
#define INT_FICNT	1
// rLPCSEL val
#define DISABLE_LPC3600	(~7)
// rTPAL val
#define DISABLE_TEMP_PALETTE 0
#define RGB(r,g,b) ((r>>3)<<11|(g>>3)<<6|(b>>3)<<1|0x0001)


struct lcd_control_obj
{
	volatile unsigned int *con1;
	volatile unsigned int *con2;
	volatile unsigned int *con3;
	volatile unsigned int *con4;
	volatile unsigned int *con5;
	volatile unsigned int *saddr1;
	volatile unsigned int *saddr2;	
	volatile unsigned int *saddr3;
	volatile unsigned int *redlut; 
	volatile unsigned int *greedlut;
	volatile unsigned int *bluelut;
	volatile unsigned int *dithmode;	
	volatile unsigned int *tpal;
	volatile unsigned int *intpnd;
	volatile unsigned int *srcpnd;
	volatile unsigned int *intmsk;
	volatile unsigned int *lpcsel;
	unsigned int (*framebuffer)[SCR_XSIZE_TFT/2];
};

#endif

